//
// Created by tang on 2020/6/18.
//

#ifndef TESTREMOTE_SSD_1306_128_64_HPP
#define TESTREMOTE_SSD_1306_128_64_HPP

#include "gpio_utility.hpp"
#include "base_display.hpp"

class SSD1306_128_64: public IPrinter {
    IIC wire_;

    char buffer_[128 * 64 / 8]{};
public:
    explicit SSD1306_128_64(IIC &&iic);

    void init();

    void inverse(bool on = true);

    void clear();

    void display();

    void drawPoint(Point2D p, bool bounded);

    void fill(bool white = true);

    char *buffer();
private:
    void onCmd(char cmd);

    void sync();
};

#endif //TESTREMOTE_SSD_1306_128_64_HPP
